﻿using UnityEngine;
using System.Collections;

public class PlaneFullScreen : MonoBehaviour {

	
	public Texture myTexture;
	
	// Use this for initialization
	void Start()
	{
		// Position the billboard in the center, 
		// but respect the picture aspect ratio
//		float textureHeight = myTexture.height;
		float textureWidth = myTexture.width;
//		float screenHeight = Screen.height;
		float screenWidth = Screen.width;
		
//		float screenAspectRatio = (screenWidth / screenHeight);
//		float textureAspectRatio = (textureWidth / textureHeight);
		
//		float scaledHeight;
//		float scaledWidth;
//				if (textureAspectRatio <= screenAspectRatio)
//				{
		// The scaled size is based on the height
//		scaledHeight = screenHeight;
//		scaledWidth = (screenHeight * textureAspectRatio);
//				}
//				else
//				{
//					// The scaled size is based on the width
//					scaledWidth = screenWidth;
//					scaledHeight = (scaledWidth / textureAspectRatio);
//				}

//		transform.localScale = new Vector3(screenWidth / textureWidth, 1, 100);
		transform.localScale = new Vector3(textureWidth / screenWidth, 1, 100);

//		Debug.Log ("screen width : " + screenWidth);
//		Debug.Log ("texture width : " + textureWidth);
	}

}
